<template>
  <div class="workdetail-container">
    <img :src="baseUrl+notice.picarr1" alt="" v-if="notice.version == 2">
    <div style="font-size: 0.3rem;" v-else v-html="notice.content"></div>
    <div style="height:1.6rem"></div>
    <div class="footer-buy">
      <div class="footer-buy-left"> 
        <div class="footer-buy-left-item" @click="onClickIcon(1)">
          <div class="buy-left-item-icon iconfont icon-fanhui1"></div>
          <div class="buy-left-item-text">返回</div>
        </div>
        <div class="footer-buy-left-item" @click="onClickIcon(2)">
          <div class="buy-left-item-icon iconfont icon-designer-code-noprev" style="font-size: 0.24rem;"></div>
          <div class="buy-left-item-text">我的功课</div>
        </div>
      </div>
      <div class="footer-buy-right" @click="onClickIcon(3)">写作业</div>
    </div>
  </div>
</template>
<script>
export default {
  name: "certificate",
  data() {
    return {
      id:'',
      baseUrl: this.$API.ASSET_IMAGES_URL,
      notice:{}
    };
  },
  filters: {
    dateFrom(e) {
      if (!e) return '';
      // return getdate(e);
    }
  },
  mounted() {
    this.id = this.$route.query.id;//作业id
    this.initAjaxMethod();
  },
  methods: {
    //列表加载
    initAjaxMethod() {
      const toast=this.$toast.loading("加载中...");
      this.$http
        .post(this.$API.GET_MEMBER_WORKDETAIL, {
          id: this.id,
          status: this.active
        })
        .then((res) => {
          toast.clear();
          if (res.code == 1) {
           this.notice=res.notice || {};
          }
        });
    },
    onClickIcon(flag) {
      if (flag == 1) {
        this.$router.back();
      } else if (flag == 2) {
        this.$router.back();
      }else if (flag == 3) {
        this.$router.push({path:'/workWrite?id='+this.id});
      }
    },
  },
};
</script>
<style lang="less">
.workdetail-container {
  height: 100%;
  position: relative;
  img{
    max-width: 100%;
  }
  .tabs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;

    .van-tabs__wrap {
      height: 0.88rem;
    }
    .van-tab__text {
      font-size: 0.32  rem;
    }
  }

  .list-group {
    height: 100%;
    padding: 0 0.2rem;
  }

  .detail-tags {
    display: flex;
    justify-content: flex-end;

    .van-tag {
      font-size: 0.3rem;
      padding: 0.1rem 0.3rem;
      border-radius: 4px;
      line-height: 0.24rem;
    }
  }

  .match-content {
    padding: 0.2rem;
    color: #3e3a39;
    display: flex;
    box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
    align-items: center;
    margin-top: 0.2rem;
    cursor: pointer;
    border-radius: 0.2rem;

    .content-img-group-mobile {
      position: relative;
      align-items: center;
      justify-content: center;

      .content-img-group {
        width: 2rem;
        height: 2rem;
        background: #fff;

        .content-img {
          width: 100%;
          height: 100%;
        }
      }
    }

    .detail-content-mobile {
      font-size: 0.3em;
      color: #3e3a39;
      padding-top: 0.08rem;
    }

    .detail-mobile {
      width: 60%;
      padding-left: 0.3rem;
      flex-grow: 1;
    }

    .detail-title {
      font-size: 0.32rem;
      color: #333;
      font-weight: bold;
    }

    .detail-info {
      display: flex;
      align-items: center;
      padding-top: 0.16rem;

      span {
        font-size: 0.3rem;
        color: #3e3a39;
      }
    }
  }

  .bottom-button {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-top: 0.2rem;
  }

  .popup-close-group {
    padding: 0.1rem 24%;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
  }
  .popup-close-button {
    height: 0.7rem;
    color: #333;
    line-height: 0.7rem;
    text-align: center;
    font-size: 0.3rem;
  }
  .popup-img{
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .popup-close-header{
    font-size: 0.32rem;
    position: absolute;
    top:0;
    left:0;
    padding:0 0.3rem;
    text-align: right;
    height: 1rem;
    line-height: 1rem;
    width: 100%;
  }
  .footer-buy{
    position: fixed;
    z-index: 100;
    background: #F7F7F7;
    border-top: 1px solid #bbb;
    display: flex;
    align-items: center;
    bottom:0;
    width: 100%;
    .footer-buy-left{
      width: 40%;
      display: flex;
      align-items: center;
    } 
    .footer-buy-left-item{
      width: 50%;
      border-left:1px solid #bbb;
      height: 1rem;
    } 
    .buy-left-item-icon{
      font-size: 0.44rem;
      line-height: 0.4rem;
      text-align: center;
      color: #666;
    }
    .buy-left-item-text{
      font-size: 0.32rem;
      color: #666;
      text-align: center;
    } 
    .footer-buy-left-item1{
      width: 30%;
      text-align: center;
      font-size: 0.32rem;
      color:#EC725D;
      border-left:1px solid #bbb;
      height: 1rem;
      line-height: 1rem;
    } 
    .footer-buy-right{
      width: 60%;
      background: #EC725D;
      color: white;
      line-height: 1rem;
      height: 1rem;
      font-size: 0.32rem;
      text-align: center;
    }
  }
}
</style>